package cache_server

import cache "../cache"
import "time"

type MemoryCacheServer struct {
  *cache.MemoryCache
}

func NewCache() *MemoryCacheServer{
  mc := &MemoryCacheServer{
    MemoryCache: cache.NewCache().(*cache.MemoryCache),
  }
  return mc
}

func(mc *MemoryCacheServer)Set(key string, val interface{}, expire ...time.Duration){
  expireDuration := time.Second * 0 //means forever
  if len(expire) == 1 {
    expireDuration = expire[0]
  }
  mc.MemoryCache.Set(key, val, expireDuration)
}
